package com.reguang.exception;

import com.reguang.enums.ResultCode;

public class ProductException extends RuntimeException {

	/** serialVersionUID*/
	private static final long serialVersionUID = 8972121227268496662L;

	private Integer errorCode;

	private String msg;

	public ProductException(String msg) {
		super(msg);
	}

	public ProductException(Integer errorCode, String msg) {
		super(msg);
		this.errorCode = errorCode;
		this.msg = msg;
	}

	public ProductException(ResultCode resultCode) {
		super(resultCode.message());
		this.errorCode = resultCode.code();
		this.msg = resultCode.message();
	}

	public Integer getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(Integer errorCode) {
		this.errorCode = errorCode;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
